using UnityEngine;
using QFramework;
using System.Collections.Generic;

namespace ProjectSurvivor
{
	public partial class BaskeBallAbility : ViewController
	{
		public List<CapsuleCollider2D> mSword = new List<CapsuleCollider2D>();
		void Start()
		{
			Ball.Hide();
			Global.SimpleSwordCount.RegisterWithInitValue(count =>
			{
				var toAddCount = count - mSword.Count;
				for (int i = 0; i < toAddCount; i++)
				{
					Debug.Log("=======");
					if (Player.Default && Ball != null && Ball.GetComponent<CapsuleCollider2D>())
					{
						
							mSword.Add(Ball.GetComponent<CapsuleCollider2D>().InstantiateWithParent(this).Show().Position(Player.Default.Position()));						
					}
				}		
			});
		}

	}
}
